import { defineStore } from "pinia";

const useCounterStore = defineStore("counter", {
  state: () => ({
    counter: 0,
  }),
  getters: {
    doubleCounter: (state) => state.counter * 2,
  },
  actions: {
    increment() {
      this.counter++;
    },
    changeCounterAction(newCounter: number) {
      this.counter = newCounter;
    }
  },
})


export default useCounterStore;
